package com.kxmall.rider.mapper;

import com.kxmall.common.core.mapper.BaseMapperPlus;
import com.kxmall.rider.domain.KxRider;
import com.kxmall.rider.domain.vo.KxRiderVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 配送Mapper接口
 *
 * @author kxmall
 * @date 2023-09-21
 */
public interface KxRiderMapper extends BaseMapperPlus<KxRiderMapper, KxRider, KxRiderVo> {

    /**
     * 查询可用的骑手信息
     *
     * @param storageId
     * @param state
     * @param workState
     * @param weekOfDate
     * @return
     */
    List<KxRider> selectListByWorkTime(@Param("storageId") Long storageId, @Param("state") int state, @Param("workState") int workState, @Param("weekOfDate") int weekOfDate);


    /**
     * 批量更新骑手状态
     *
     * @param ids   骑手主键集合
     * @param state 骑手资料状态
     * @return 影响行数
     */
    Integer batchUpdateState(@Param("ids") List<Long> ids, @Param("state") int state);

    /**
     * 批量更新前置仓库资料营业状态
     *
     * @param ids       前置仓库主键集合
     * @param workState 前置仓库资料营业状态
     * @return 影响行数
     */
    Integer batchUpdateWeekState(@Param("ids") List<Long> ids, @Param("workState") int workState);


}
